// 封装文章相关的接口
import request from '@/utils/request'

// 获取文章分类接口
export const getArticleCatagoryAPI = () => {
  return request.get('/my/cate/list')
}

// 添加文章分类接口
export const addArticleCatagoryAPI = (data) => {
  return request.post('/my/cate/add', data)
}

// 更新文章分类接口
export const updateArticleCatagoryAPI = (data) => {
  return request.put('/my/cate/info', data)
}

// 删除文章分类接口
export const deleteArticleCatagoryAPI = (id) => {
  return request.delete(`/my/cate/del`, { params: { id } })
}

// 获取文章列表接口
export const getArticleListAPI = (data) => {
  return request.get('/my/article/list', { params: data })
}

// 添加文章
export const addArticleAPI = (data) => {
  return request.post('/my/article/add', data)
}

// 获取文章详情
export const getArticleDetailAPI = (id) => {
  return request.get(`/my/article/info`, { params: { id } })
}

// 编辑文章
export const editArticleAPI = (data) => {
  return request.put(`/my/article/info`, data)
}

// 删除文章
export const deleteArticleAPI = (id) => {
  return request.delete(`/my/article/info`, { params: { id } })
}
